/*
 * @Description: 
 * @Author: zhangwei
 * @Date: 2023-03-02 11:16:26
 * @LastEditTime: 2023-03-03 15:56:23
 * @LastEditors: zhangwei
 */
/**
 * 配置浏览器本地存储的方式，可直接存储对象数组。
 */

import WebStorageCache from 'web-storage-cache'

type CacheType = 'sessionStorage' | 'localStorage'

export const useCache = (type: CacheType = 'sessionStorage') => {
  const wsCache: WebStorageCache = new WebStorageCache({
    storage: type
  })

  return {
    wsCache
  }
}
